﻿@using System.Net.Mime
@using DataMongo
@model IEnumerable<DataMongo.Entities.Users>
@{
    ViewBag.Title = "Users";
}
<div class="row">
    <div class="col-lg-12">
        <h2>Users</h2>
        @*<p>@Html.ActionLink("Create", "UserAdd", "SuperAdmin", "", new { @class = "btn btn-info" })</p>*@
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped tablesorter">
                <thead>
                    <tr>
                        <th>Name <i class="fa fa-sort"></i></th>
                        <th>Email Address <i class="fa fa-sort"></i></th>
                        <th>Gender<i class="fa fa-sort"></i></th>
                        <th>DOB <i class="fa fa-sort"></i></th>
                        <th width="15%">

                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.FirstName  @item.LastName</td>
                            <td>@item.UserName</td>
                            <td>
                                @if (item.Gender == "M")
                                {
                                    <text>Male</text>
                                }
                                else
                                {
                                    <text>Female</text>
                                }

                            </td>
                            <td>
                                @item.BirthDay.ToLongDateString()

                            </td>
                            <td>
                                @Html.ActionLink("Edit", "UserEdit", new { id = item.UserId }) |
                                @Html.ActionLink("Delete", "UserDelete", new { id = item.UserId})
                            </td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
